import { IRewriteCreateAxiosDefaults } from "./@type"
import { formatToken } from "@/utils"

export default {
  "401": "认证失败，无法访问系统资源",
  "403": "当前操作没有权限",
  "404": "访问资源不存在",
  default: "系统未知错误，请反馈给管理员"
}

export const baseConfig: IRewriteCreateAxiosDefaults = {
  baseURL: import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL,
  timeout: 3000,
  responseEncoding: "utf8",
  headers: {
    "Content-Type": "application/json",
    Authorization: formatToken()
  },
  responseType: "json"
}
